package com.xxh.cloud.common.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class R implements Serializable {
    private int code;
    private String msg;
    private Object data;
    //成功
    public static R ok(Object obj){
        return new R(200,"OK",obj);
    }
    public static R ok(){
        return new R(200,"OK",null);
    }
    //失败
    public static R fail(String msg){
        return new R(10001,msg,null);
    }
    public static R fail(){
        return new R(10001,"FAIL",null);
    }
}
